Las Reliquias de Tolti Aph

An interactive fiction by Graham Nelson (2005) - the Inform 7 source text

Home page

Contents
Previous
Next

Complete text
Section 1(e) - Experiencia y niveles

A person has a number called level. The level of a person is usually 1.[1]

Table of Level Advancement
level number   experience points to progress
1   50
2   100
3   250
4   600
5   0

Every turn:
    let the current level be the level of the player;
    if the current level is 5, stop;
    let the target be the experience points to progress corresponding to a level number of the current level in the Table of Level Advancement;
    if the score is greater than the target
    begin;
        say "¡Subes al nivel [current level plus 1]!";
        increase the level of the player by 1;
    end if.

Procedural rule: ignore the announce the score rule.[2]

Carry out requesting the score:
    say "Eres un usuario de magia de nivel [level of the player], con [score] punto[s] de experiencia.";
    let the current level be the level of the player;
    let the target be the experience points to progress corresponding to a level number of the current level in the Table of Level Advancement;
    let the target be the target minus the score;
    if the current level is 5, say "No es posible subir más de nivel." instead;
    if the target <= 0, say "Pronto subirás al siguiente nivel." instead;
    say "Necesitas [target] punto[s] [if the score > 0]más [end if]para subir al siguiente nivel." instead.

When play begins, change the right hand status line to "NVL: [level of the player] FUE: [strength of the player]".[3]

Notes

[1]. Parece que a los RPGs les gusta la idea de niveles numerados, con un usuario de magia de nivel 3 un poquito más pujante que uno de nivel 2. Creo que esto deriva del vago sentido de misterio alrededor de los "grados" de las logias masónicas, "The Benevolent and Protective Order of the Elks", y cosas por el estilo.

[2]. Esta es la regla por defecto en Inform que usualmente maneja el comando PUNTOS. Necesitamos tirarla a la basura porque estamos, de alguna forma, subvertiendo las convenciones usuales por usar los puntos para representar el total de puntos de experiencia acumulados por el jugador; lo cual significa que necesitamos escribir nuestra propia rutina para decirle al jugador cual son sus puntos actuales, tal y como sigue.

[3]. Uno se vuelve débil al realizar magia o ser herido, más fuerte al descansar o ser curado; uno gana experiencia teniendo una vida ocupada. Estas cuentas importan mucho, así que vamos a hacer que sean prominentemente visibles a todas horas en la barra de estado - la barra sobre la pantalla.